package com.eiot.framework.demo.service.Impl;

import com.eiot.framework.demo.dao.ExampleMapper;
import com.eiot.framework.demo.dto.req.AddSysUserDto;
import com.eiot.framework.demo.dto.req.DeleteSysUserDto;
import com.eiot.framework.demo.dto.req.QuerySysUserDto;
import com.eiot.framework.demo.dto.req.UpdateSysUserDto;
import com.eiot.framework.demo.entity.SysUser;
import com.eiot.framework.demo.service.ExampleService;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class ExampleServiceImpl implements ExampleService {

    @Resource
    ExampleMapper exampleMapper;

    @Override
    public List<SysUser> queryUserListByPage(QuerySysUserDto req){
        int pageNum = req.getPageNum();
        int pageSize = req.getPageSize();
        // 分页
        PageHelper.startPage(pageNum,pageSize);
        List<SysUser> userList = exampleMapper.queryUserListByPage(req);
        return userList;
    }

    @Override
    public int addUser(AddSysUserDto req) {
        return 0;
    }

    @Override
    public int updateUser(UpdateSysUserDto req) {
        return 0;
    }

    @Override
    public int deleteUser(DeleteSysUserDto req) {
        return 0;
    }

}
